<?php


namespace App\Admin\Controllers;


use App\Models\Cate;
use Dcat\Admin\Http\Controllers\AdminController;
use Illuminate\Http\Request;

class ApiController extends AdminController
{
    public function getCate(Request $request){
        $id = $request->q;
        return Cate::where('pid',$id)->get(['id', \DB::raw('name as text')]);
    }
}
